{{include file="header_inc.html"}}
<SCRIPT>
	if (window.top.$("#current_pos").data('clicknum') == 1
			|| window.top.$("#current_pos").data('clicknum') == null) {
		parent.document.getElementById('display_center_id').style.display = '';
		parent.document.getElementById('center_frame').src = '/content/manage/categorys/';
		window.top.$("#current_pos").data('clicknum', 0);
	}

	//推送
	function push() {
		var str = 0;
		var id = tag = '';
		$("input[name='ids[]']").each(function() {
			if ($(this).attr('checked') == 'checked') {
				str = 1;
				id += tag + $(this).val();
				tag = ',';
			}
		});
		if (str == 0) {
			window.top.art.dialog({
				icon : 'error',
				content : '您没有勾选信息!'
			});
			return false;
		}
		window.top.art.dialog({
			id : 'push'
		}).close();
		window.top.art.dialog({
			title : '推送',
			id : 'push',
			iframe : '/content/manage/push/id/' + id + '/',
			width : '800',
			height : '500'
		}, function() {
			var d = window.top.art.dialog({
				id : 'push'
			}).data.iframe;// 使用内置接口获取iframe对象
			var form = d.document.getElementById('dosubmit');
			form.click();
			return false;
		}, function() {
			window.top.art.dialog({
				id : 'push'
			}).close()
		});
	}

	//批量移动
	function remove() {
		var str = 0;
		var id = tag = '';
		$("input[name='ids[]']").each(function() {
			if ($(this).attr('checked') == 'checked') {
				str = 1;
				id += tag + $(this).val();
				tag = ',';
			}
		});
		if (str == 0) {
			window.top.art.dialog({
				icon : 'error',
				content : '您没有勾选信息!'
			});
			return false;
		}
		window.top.art.dialog({
			id : 'remove'
		}).close();
		window.top.art.dialog({
			title : '批量移动',
			id : 'remove',
			iframe : '/content/manage/remove/id/' + id + '/',
			width : '800',
			height : '450'
		}, function() {
			var d = window.top.art.dialog({
				id : 'remove'
			}).data.iframe;// 使用内置接口获取iframe对象
			var form = d.document.getElementById('dosubmit');
			form.click();
			return false;
		}, function() {
			window.top.art.dialog({
				id : 'remove'
			}).close()
		});
	}

	//删除新闻
	function confirm_delete() {
		if (confirm('确认删除吗？')) {
			$('#myform').submit()
		}
	}

	//查看评论
	function view_comment(id, name) {
		window.top.art.dialog({
			id : 'view_comment'
		}).close();
		window.top.art.dialog({
			yesText : '关闭',
			title : '查看评论：' + name,
			id : 'view_comment',
			iframe : '/content/comment/show/commentid/' + id + '/',
			width : '800',
			height : '500'
		}, function() {
			window.top.art.dialog({
				id : 'edit'
			}).close()
		});
	}

	function refersh_window() {
		var refersh_time = getcookie('refersh_time');
		if (refersh_time == 1) {
			window.location.reload();
		}
	}

	$(document).ready(function() {
		setInterval(closeParent, 5000);
		setcookie('refersh_time', 0);
		setInterval("refersh_window()", 3000);

		Calendar.setup({
			weekNumbers : false,
			inputField : "start_time",
			trigger : "start_time",
			dateFormat : "%Y-%m-%d",
			showTime : false,
			minuteStep : 1,
			onSelect : function() {
				this.hide();
			}
		});

		Calendar.setup({
			weekNumbers : false,
			inputField : "end_time",
			trigger : "end_time",
			dateFormat : "%Y-%m-%d",
			showTime : false,
			minuteStep : 1,
			onSelect : function() {
				this.hide();
			}
		});
	});
	function closeParent() {
		if ($('#closeParentTime').html() == '') {
			window.top.$(".left_menu").addClass("left_menu_on");
			window.top.$("#openClose").addClass("close");
			window.top.$("html").addClass("on");
			$('#closeParentTime').html('1');
			window.top.$("#openClose").data('clicknum', 1);
		}
	}

	//ajax分面
	function ContentPage(ajax_url, page) {
		var ajax_url = ajax_url + '?page=' + page;
		dialog(ajax_url, 'content_list');
	}
</SCRIPT>
<body>
	<div id="closeParentTime" style="display: none"></div>
	<div class="pad-10">
		<div class="content-menu ib-a blue line-x">
			<a class="add fb" href="javascript:;"
				onclick="javascript:openwinx('/content/manage/add/id/{{$id}}/','')"><em>添加内容</em></a>
		</div>
		<div id="searchid">
			<form name="searchform" action="/content/manage/search/"
				method="post">
				<input type="hidden" value="{{$id}}" name="catid">
				<table width="100%" cellspacing="0" class="search-form">
					<tbody>
						<tr>
							<td>
								<div class="explain-col">
									添加时间： <input type="text" name="start_time" id="start_time"
										value="" size="10" class="date" readonly>&nbsp; -
									&nbsp;<input type="text" name="end_time" id="end_time" value=""
										size="10" class="date" readonly>&nbsp; <select
										name="posids"><option value='' selected>全部</option>
										<option value="1">推荐</option>
										<option value="2">不推荐</option>
									</select> <select name="searchtype">
										<option value='1' selected>标题</option>
										<option value='2'>简介</option>
										<option value='3'>用户名</option>
										<option value='4'>ID</option>
									</select> <input name="keyword" type="text" value="" class="input-text" />
									<input type="submit" name="dosearch" class="button" value="搜索" />
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
		<div id="content_list">
			<form name="myform" id="myform" action="" method="post">
				<input type="hidden" name="dosubmit" value="1"></input>
				<div class="table-list">
					<table width="100%">
						<thead>
							<tr>
								<th width="16"><input type="checkbox" value=""
									id="check_box" onclick="selectall('ids[]');"></th>
								<th width="37">排序</th>
								<th width="40">ID</th>
								<th>标题</th>
								<th width="40">点击量</th>
								<th width="70">发布人</th>
								<th width="118">更新时间</th>
								<th width="72">管理操作</th>
							</tr>
						</thead>
						<tbody>
							{{foreach item=content from=$News_list}}
							<tr>
								<td align="center"><input class="inputcheckbox "
									name="ids[]" value="{{$content.id}}" type="checkbox"></td>
								<td align='center'><input
									name='listorders[{{$content.id}}]' type='text' size='3'
									value='{{$content.listorder}}' class='input-text-c'></td>
								<td align='center'>{{$content.id}}</td>
								<td><a href="javascript:;"
									onclick="javascript:openwinx('/content/manage/edit/catid/{{$id}}/id/{{$content.id}}/','')">
										<span style="">{{$content.title}}</span>
								</a> {{if $content.news_img}} <img title="缩略图"
									src="{{#siteImgPath#}}/icon/small_img.gif"> {{/if}}</td>
								<td align='center'
									title="今日点击：0&#10;昨日点击：&#10;本周点击：0&#10;本月点击：0">{{$content.hits}}</td>
								<td align='center'>{{$content.username}}</td>
								<td align='center'>{{$content.updatetime}}</td>
								<td align='center'><a href="javascript:;"
									onclick="javascript:openwinx('/content/manage/edit/catid/{{$id}}/id/{{$content.id}}/','')">修改</a>
									| <a
									href="javascript:view_comment('{{$content.id}}','{{$content.title}}')">评论</a>
								</td>
							</tr>
							{{/foreach}}
						</tbody>
					</table>
					<div class="btn">
						<input type="button" class="button" value="排序"
							onclick="myform.action='/content/manage/listorder/catid/{{$id}}/';myform.submit();" />
						<input type="button" class="button" value="删除"
							onclick="myform.action='/content/manage/delete/catid/{{$id}}/';return confirm_delete()" />
						<input type="button" class="button" value="推送" onclick="push();" />
						<input type="button" class="button" value="批量移动"
							onclick="remove();" />
					</div>
					<div id="pages">{{$pageBlock}}</div>
				</div>
			</form>
		</div>
	</div>
</body>
{{include file="footer.html"}}
